sudo: false
language: node_js
node_js:
  - '9'
  - '8'
  - '7'
  - '6'
  - '5'
  - '4'
before_install:
  - 'nvm install-latest-npm'
before_script:
  - 'if [ -n "${ESLINT-}" ]; then npm install --no-save "eslint@${ESLINT}" ; fi'
script:
  - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
  - 'if [ -n "${TEST-}" ]; then npm run unit-test ; fi'
env:
  - TEST=true
after_success:
  - 'if [ -n "${TEST-}" ]; then npm run coveralls ; fi'
matrix:
  fast_finish: true
  include:
    - node_js: 'lts/*'
      env: PRETEST=true
    - node_js: '9'
      env: TEST=true ESLINT=next
    - node_js: '8'
      env: TEST=true ESLINT=next
    - node_js: '7'
      env: TEST=true ESLINT=next
    - node_js: '6'
      env: TEST=true ESLINT=next
    - node_js: '9'
      env: TEST=true ESLINT=3
    - node_js: '8'
      env: TEST=true ESLINT=3
    - node_js: '7'
      env: TEST=true ESLINT=3
    - node_js: '6'
      env: TEST=true ESLINT=3
    - node_js: '5'
      env: TEST=true ESLINT=3
    - node_js: '4'
      env: TEST=true ESLINT=3
  allow_failures:
    - node_js: '9'
    - node_js: '7'
    - node_js: '5'
    - env: TEST=true ESLINT=next
